<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title></title>
	</head>
	
	<body>
		
	</body>
	
	<script>
		//成绩分为四个等级，A\B\C\D
		var score = 89;
		/*
		if( score >= 90 ) {
			console.log("等级为A");
		} else if(score >= 80) {
			console.log("等级为B");
		} else if(score >= 70) {
			console.log("等级为C");
		} else if(score >= 60) {
			console.log("等级为D");
		} else {
			console.log("降级");
		}
		*/
		
		switch( parseInt(score/10) ) {
			case 10 : console.log("恭喜你！"); break;
			case 9 : console.log("等级为A"); break;
			case 8 : console.log("等级为B"); break;
			case 7 : console.log("等级为C"); break;
			case 6 : console.log("等级为D"); break;
			default : console.log("降级");
		}
		
		
		
	</script>
	
	
</html>



